<template>
	<view class="viewbox auto">
		
		<view class="row j-sb p-left10 p-right10 m-top20">
			<block v-for="(item,index) in pageData" :key="index">
				<view class="list bg28 bor_radius_20 p-bot20 m-bot20"
				     @click="toUrl(`/pages/user/myArtDetail?goodsId=${item.id}`)">
					<view class="listImg flexac hidden">
						<image :src="item.goods_image" class="wh"></image>
					</view>
					<view class="row p-left10 p-right10">
						<view class="rows white ellipsis size26 m-top20">{{item.goods_name}}</view>
						<view class="toKenNum d-flex a-center m-top14" v-if="item.goods_count == 1">
							 <view class="tokenOn flexac">
								 <image src="../../static/imgs/bg02.png" class="tokenIcon"></image>
							 </view>
							 <view class="tonum  ellipsis p-left50  white h7 ">
							 {{item.token_id}}#{{item.number}}/{{item.stock}}
							</view>
						</view>
					
						<view class="rows white ellipsis size26 m-top20">{{item.creator}}</view>
						<view class="row white size26 m-top20" v-if="item.goods_count > 1">X {{item.goods_count}}</view>
					</view>
				</view>
			</block>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goods_id:'',
				pageData:[],
				is_compose:0,  // 0 我的藏品 1 我的合成
			}
		},
		onLoad(option) {
			if(option.goods_id) this.goods_id = option.goods_id;
			if(option.is_compose) this.is_compose = option.is_compose;
		},
		onShow() {
			this.getList();
		},
		methods: {
			getList() {
				this.$http.post('order/collectionList', {
					status: 1,
					goods_id:this.goods_id,
					is_compose:this.is_compose
				}).then(res => {
					if (res.code == 401) return;
					if (res.code != 1) return this.$Toast(res.msg);
					let info = res.data;
					this.$BarTitle(info[0].goods_name)
					info.forEach((item,index)=>{
						if(item.goods && item.goods.length) all.goods = all.goods.concat(item.goods)
					})
					
					this.pageData = info;
					
				})
			},
		}
	}
</script>
<style>
	page {
		background-color: #1e201f;
	}
</style>
<style lang="scss" scoped>
	.list {
		width: 300rpx;
	}
	.listImg {
		width: 100%;
		height: 300rpx;
		vertical-align: top;
	}
	.toKenNum{
		width:100%;
		height: 50rpx;
		position: relative;
	}
	.tokenOn{
		width:50rpx;
		height: 50rpx;
		background-image: url(@/static/imgs/bg01.png);
		background-repeat: no-repeat;
		background-size: 100% 100%;
		position: relative;
		z-index:10;
	}
	.tokenIcon{
		width:30rpx;
		height: 24rpx;
	}
	.tonum{
		width: 90%;
		height: 44rpx;
		line-height: 44rpx;
		background-color: #eab855;
		margin-left:-40rpx;
		border-radius: 22rpx;
	}
</style>
